﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Report.Master" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Import Namespace="Equipment.Business" %>

<%@ Import Namespace="Equipment.DataAccess" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Work Order Detail Report
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Dim wo As WorkOrder = ViewData("WorkOrder")%>
    <h1>
        Work Order
        <%: wo.ID%>
        Summary Report</h1>
    <br />
    <table class="data-table" cellpadding="10" cellspacing="0" style="margin-left:0; width:100%;">
        <tr>
            <th align="left">
                Work Order #
            </th>
            <td>
                <%: wo.ID%>
            </td>
            <td rowspan="4" style="vertical-align:top;">
                <table  cellpadding="5" cellspacing="0" class="blue right">
                    <tr>
                        <th>
                            Asset Id:
                        </th>
                        <td>
                            <%: wo.AssetID%>
                        </td>
                        <th>
                            Model #:
                        </th>
                        <td>
                            <%: wo.Asset.ModelNo%>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Asset Name:
                        </th>
                        <td>
                            <%: wo.Asset.AssetName%>
                        </td>
                        <th>
                            Serial #:
                        </th>
                        <td>
                            <%: wo.Asset.SerialNo%>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Asset Type:
                        </th>
                        <td>
                            <%: wo.Asset.AssetType.Description%>
                        </td>
                        <th>
                            &nbsp;
                        </th>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Department:
                        </th>
                        <td>
                            <%: wo.Asset.SiteDepartment.Description%>
                        </td>
                        <th>
                            &nbsp;
                        </th>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <th align="left">
                Type of Work Order
            </th>
            <td>
                <%: RequirementTypeLookup.GetDescriptionByType(wo.RequirementType)%>
            </td>
        </tr>
        <tr>
            <th align="left">
                Due Date:
            </th>
            <td>
                <%: wo.DateDue.ToString("dd-MMM-yyyy hh:mm")%>
            </td>
        </tr>
        <tr>
            <th align="left">
                Work Order Status:
            </th>
            <td>
                <%: WorkOrderStatus.GetDescriptionByType(wo.Status)%>
            </td>
        </tr>
        <tr>
            <th align="left">
                Additional Details:
            </th>
            <td colspan="2">
                <%: wo.Description%>
            </td>
        </tr>
    </table>
    <br />
    <h4>History</h4>
    <table class="data-table left" width="75%">
        <thead>
            <tr>
                <th>
                    Action
                </th>
                <th>
                    Action Date
                </th>
                <th>
                    By User
                </th>
            </tr>
        </thead>
        <tbody>
            <% For Each item In ViewData("History")%>
            <tr>
                <td width="25%">
                    <%: item.Action%>
                </td>
                <td width="25%">
                    <%: item.ActionDate%>
                </td>
                <td width="50%">
                    <%: item.ByUser%>
                </td>
            </tr>
            <% Next%>
        </tbody>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FormContent" runat="server">
    <%= Html.Hidden("WorkOrderID", ViewData("WorkOrderID"))%>
</asp:Content>
